package com.heima.wemadia.controller;


import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dto.WmSensitiveDto;
import com.heima.model.wemedia.dto.WmSensitiveListDto;
import com.heima.model.wemedia.entity.WmSensitive;
import com.heima.wemadia.service.WmSensitiveService;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 自媒体敏感词表(WmSensitive)表控制层
 *
 * @author makejava
 * @since 2022-04-22 18:14:06
 */
@RestController
@RequestMapping("/api/v1/sensitive")
public class WmSensitiveController {
    /**
     * 服务对象
     */
    @Resource
    private WmSensitiveService wmSensitiveService;

    @PostMapping("/save")
    public ResponseResult save(@RequestBody WmSensitiveDto dto) {
        return wmSensitiveService.save(dto);
    }

    @PostMapping("/list")
    public ResponseResult list(@RequestBody WmSensitiveListDto dto) {
        return wmSensitiveService.list(dto);
    }

    @PostMapping("/update")
    public ResponseResult update(@RequestBody WmSensitiveDto dto) {
        return wmSensitiveService.alter(dto);
    }

    @DeleteMapping("/del/{id}")
    public ResponseResult delete(@PathVariable("id") Long id) {
        return wmSensitiveService.delete(id);
    }

}

